package presentation.view;

/**
 *
 * @author Alexander
 */
public class ViewHelper {

    public boolean validateString(String cadena) {
        boolean val = false;
        for (int i = 0; i < cadena.length(); i++) {
            if ((cadena.charAt(i) >= 65 && cadena.charAt(i) <= 90) || (cadena.charAt(i) >= 97 && cadena.charAt(i) <= 122) || (cadena.charAt(i) == 32)) {
                val = true;
            } else {
                val = false;
                break;
            }
        }
        return val;
    }

    public boolean validateNumbers(String cadena) {
        boolean val = false;
        for (int i = 0; i < cadena.length(); i++) {
            if (cadena.charAt(i) >= 48 && cadena.charAt(i) <= 57) {
                val = true;
            } else {
                val = false;
                break;
            }
        }
        return val;
    }
}
